﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System
{
    public class SNModel<SModel, NModel>
        where SModel : BaseModel, new()
        where NModel : BaseModel, new()
    {
        public SModel Model { get; set; }

        public List<NModel> NModles { get; set; }
        public string NRelationFieldName { get; set; }
        public string NSubListJsonData { get; set; }

        public SNModel()
        {
            NSubListJsonData = "[]";
        }
    }

    public class SNiiModel<SModel, NModel, NiiModel> : SNModel<SModel, NModel>
        where SModel : BaseModel, new()
        where NModel : BaseModel, new()
        where NiiModel : BaseModel, new()
    {

        public List<NiiModel> NiiModles { get; set; }
        public string NiiRelationFieldName { get; set; }
        public string NiiSubListJsonData { get; set; }

        public SNiiModel()
            : base()
        {

            NiiSubListJsonData = "[]";
        }
    }
    public class SNDataModel<SModel, NModel, NNModel, NData>
        where SModel : BaseModel, new()
        where NModel : BaseModel, new()
        where NNModel : BaseModel, new()
        where NData : SNModel<NModel, NNModel>, new()
    {
        public virtual List<NData> NDatas { get; set; }
        public virtual string NiiRelationFieldName { get; set; }
        public virtual string NiiSubListJsonData { get; set; }

        public SNDataModel()
            : base()
        {
            NiiSubListJsonData = "[]";
        }
    }
}
